﻿package view.components.background 
{
	import flash.display.Shape;
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author Lobanov
	 */
	public class PatternBg extends Sprite
	{
		
		private var _backGroundSprite:Sprite;
		
		public function PatternBg() 
		{
			_backGroundSprite = new Sprite();
			this.addChildAt(_backGroundSprite, 0);			
		}
		
		/**
		 * Update pattern bg, simple
		 * @param	$width
		 * @param	$height
		 */
		public function updateBg($width:Number, $height:Number):void {
			_backGroundSprite.graphics.clear();
			_backGroundSprite.graphics.beginBitmapFill(new Bga(0,0));
			_backGroundSprite.graphics.drawRect(0, 0, $width, $height);
			_backGroundSprite.graphics.endFill();
			
			_backGroundSprite.alpha = .4;
		}		
	}

}